home *** CD-ROM | disk | FTP | other *** search
/ Alles Voor Internet / Tout Pour Internet / alles voor internet.iso / MacInternet™ / Unix / maclayersunixend1.30.shar / 1.30 / layertitle.c < prev    next >
C/C++ Source or Header  |  1993-06-17  |  1KB  |  44 lines

  1. /*             
  2.  *        Copyright 1993 by Eric C. Rosen
  3.  *        Copyright 1989-1992 by David W. Trissel
  4.  *
  5.  *  Not derived from licensed software.
  6.  *
  7.  * Permission is granted to freely use, copy, modify, and redistribute
  8.  * this software, provided that no attempt is made to gain profit from it,
  9.  * the author is not construed to be liable for any results of using the
  10.  * software, alterations are clearly marked as such, and this notice is
  11.  * not modified.
  12.  *
  13.  */
  14.                 /*         All rights reserved.        */
  15.  
  16.             /* layertitle - utility to specify window title */
  17.  
  18. #include <stdio.h>
  19.  
  20. #define ESC 0x1b
  21.  
  22.             /* main() - send string designating layers window title */
  23.  
  24. main(ac, av)
  25. int         ac;                         /* argument count */
  26. char        **av;                       /* argument vector */
  27. {
  28.     char        *ap;                    /* argument scan pointer */
  29.  
  30.     if (--ac != 1)
  31.       { fputs("usage: layertitle \"new window title\"\n", stderr);
  32.         exit(1);
  33.       }
  34.        
  35.     ap = *++av;                         /* point to argument string */
  36.  
  37.     /* Transmit the title string in the ANSI Private Message format
  38.     ** which is
  39.     **              ESC '^' message ESC '\'
  40.     */
  41.     printf("%c%c%s%c%c", ESC, '^', ap, ESC, '\\');
  42.  
  43. }  /* main() */
  44.